This invention relates to a method and apparatus for compensating for jitter in a digital video image, especially when the digital video image is to be encoded for storage and/or onward transmission so as to produce a stabilized digital video image. In particular, the invention relates to compensating for jitter caused by, for example, a person holding a video camera in their hand(s) when recording the video images.
When a person holds a video camera in their hands during recording of digital video images, jitter usually occurs due to the fact that the hands cannot hold the camera very steady. To achieve effective stabilization accurate estimation of the jitter motion is required. Jitter estimation is a difficult problem, because hand shaking, camera panning, zooming and actual motion of the objects can exist concurrently while video images are captured. As a result, most digital stabilizers are designed with a jitter estimation unit which is essentially used to separate the jitter motion from other motion.
The known techniques used for jitter estimation are usually based on fuzzy logic with a large set of heuristic rules. To make reliable decisions data averaging over 5-10 images (frames) is widely used. While image stabilization can thus be achieved, such a design restricts the performance of a digital stabilizer because of the long latency. Moreover, the use of fuzzy logic algorithms introduces complexity for hardware design.
Digital image stabilizers used to compensate camera (hand) shaking (or jitter motion) are standard components of many current analog video camcorders because, once images are recorded on a video tape, there is no way to change them without digitization. As a result, image stabilization has to be performed during recording. However, with digital video cameras, image stabilization does not have to be performed during the capturing process. For digital video, images captured are compressed during recording. Before the recorded video can be viewed, a decoding process has to be performed. Therefore, image stabilization can be done either during the encoding process, at the video camcorder, or during decoding, at the video viewing end, or, indeed, at any stage in between.
In this specification, including the claims, the terms xe2x80x9ccomprisesxe2x80x9d, xe2x80x9ccomprisingxe2x80x9d or similar terms are intended to mean a non-exclusive inclusion, such that a method or apparatus that comprises a list of elements does not include those elements solely, but may well include other elements not listed.
The present invention therefore seeks to provide a method and apparatus for compensating for jitter in a digital image forming part of a video sequence of such digital images which overcome, or at least reduce the above-mentioned problems of the prior art.
Accordingly, in a first aspect, the invention provides a method of compensating for jitter in a digital image forming part of a video sequence of such digital images, the method comprising the steps of providing a plurality of motion vectors each corresponding to one of a plurality of image blocks making up the digital image, wherein the step of providing a plurality of motion vectors includes the steps of, for each of the plurality of image blocks: determining a corresponding best matching image block in the previous digital image; determining a displacement value between the location of the image block in the digital image and the location of the corresponding best matching image block in the previous digital image; and utilizing the displacement value for the image block to determine an initial motion vector for that image block, determining a jitter vector from the plurality of motion vectors for the digital image and from a second plurality of motion vectors provided for a previous digital image in the video sequence, wherein the step of determining a jitter vector utilizes the initial motion vectors to determine the jitter vector; and adjusting the digital image using the jitter vector to compensate for jitter in the digital image to produce a jitter compensated digital image.
In a preferred embodiment, the step of providing a plurality of motion vectors further includes the steps of, for each of image block in the jitter compensated digital image determining a corresponding best matching image block in the digital image; and utilizing the initial motion vector for the corresponding best matching image block and the jitter vector to determine a jitter-compensated motion vector for the image block in the jitter compensated digital image, wherein the jitter-compensated motion vectors form the plurality of motion vectors.
According to a second aspect, the invention provides apparatus for compensating for jitter in a digital image forming part of a video sequence of such digital images, the apparatus comprising a motion estimation unit having an input for receiving sensed image data and an output for providing the plurality of motion vectors, each corresponding to one of a plurality of image blocks making up the digital image; a jitter estimation unit coupled to the motion estimation unit for determining a jitter vector from the plurality of motion vectors for the digital image and from a second plurality of motion vectors provided for a previous digital image in the video sequence, the jitter estimation unit comprising: an input terminal for receiving the plurality of motion vectors; a motion vector integrator having an input coupled to the input terminal and an output, the motion vector integrator generating a motion vector histogram of the frequency of motion vector values at the output thereof; a histogram analyzer having a first input coupled to the output of the motion vector integrator and a second input coupled to an output of a buffer having stored therein the motion vector histogram for a previous digital image, the histogram analyzer correlating the two motion vector histograms to determine a maximum correlation value, which is utilized by the jitter estimation unit to provide the jitter vector; and adjusting means coupled to the jitter estimation unit for adjusting the digital image using the jitter vector to compensate for jitter in the digital image to produce a jitter compensated digital image.